package ControlLayer;
import ModelLayer.CustomerContainer;
import ModelLayer.Customer;
import java.util.ArrayList;

/**
 * Vestbjerg project
 * @GroupB2 (UCN - Computer Science DMAJ0914) 
 */
public class CustomerCtr
{
    // instance variables
    private CustomerContainer customerContainer;

    /**
     * Constructor for objects of class CustomerCtr
     */
    public CustomerCtr()
    {
        customerContainer = CustomerContainer.getInstance();
    }

    public void createCustomer(String id, String name, String address, String phone, String email, String type) 
    {
        Customer customer = new Customer(id,name,address,phone,email,type);
        customerContainer.addCustomer(customer);
    }

    public Customer findCustomer(String id) 
    {
        return customerContainer.findCustomer(id);
    }

    public void updateCustomer(Customer customer, String id, String name, String address, String phone, String email, String type) 
    {
        customer.setId(id);
        customer.setName(name);
        customer.setAddress(address);
        customer.setPhone(phone);
        customer.setEmail(email);
        customer.setType(type);
    }

    public void deleteCustomer(Customer customer) 
    {
        customerContainer.deleteCustomer(customer);
    }
    
    public ArrayList<String> customerSort() 
    {
        return customerContainer.customerSort();
    }
    
    public ArrayList<Customer> getCustomerList() 
    {
     return customerContainer.getCustomerList();
    }
}
